<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<title>我要提问 - <Zml:title /></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="__PUBLIC__/css/pintuer.css">
	<link rel="stylesheet" href="__THEME__/default/css/zml.css">
	<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
	<script src="__PUBLIC__/js/respond.js"></script>
	<script src="__PUBLIC__/lib/layer/layer.js"></script>
</head>
<body class="padding">
	<form class="form">
		<div class="form-group">
			<div class="label">
				<label for="title">问题概述</label>
			</div>
			<div class="field field-icon-right">
				<input type="text" class="input" id="title" name="title" size="30" placeholder="问题概述" />
			</div>
		</div>
		<div class="form-group">
			<div class="label">
				<label for="content">问题内容</label>
			</div>
			<div class="field field-icon-right">

				<textarea type="text" class="input" id="content" name="content" size="90" placeholder="请填写您想问的问题！"></textarea>
			</div>
		</div>
		<div class="form-button"><button class="button radius-none bg-red " type="button" onClick="sub(this)">发布</button></div>
	</form>
</body>
</html>
<script>
function sub(a){
	var title = $('input[name="title"]');
	var content = $('textarea[name="content"]');
	if(title.val()==''){
		layer.tips("请填写标题","#title",{
		    tips: 1
		})
		title.focus();
		return false
	}
	if(content.val()==''){
		layer.tips("请填写问题内容","#content",{
		    tips: 1
		})
		content.focus();
		return false
	}
	$.post("__MODULE__/Qa/questions_in", {
	 	title: title.val(),
	 	content: content.val(),
	 	itemid:{$_GET['itemid']}
	},function(d){
		if (d.status == 1) {
			parent.$('#tab-d').text('我被改变了');
			parent.layer.close(index);
		}else{
			alert(d.info);
		}
   	});
}
</script>